{extend name="index/index" /}
        

{block name="main"}
<div style="margin:100px auto;width:860px;" id="Modals-frame">
        <div class="row" style="" id="Modals-add" style="">
            <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                <div class="widget am-cf">
                    <div class="widget-head am-cf">
                        <div class="widget-title am-fl">编辑角色</div>
                        <div class="widget-function am-fr">
                            <a href="javascript:;" class="am-icon-cog"></a>
                        </div>
                    </div>
                    <div class="widget-body am-fr">

                        {volist name="data" id="v"}
                        <form class="am-form tpl-form-border-form tpl-form-border-br" id="Modals-form" action="{:url('admin/index/doEditRole',['id' => $v['id']])}" method="post">
                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label">角色名称 <span
                                        class="tpl-form-line-small-title">Name</span></label>
                                <div class="am-u-sm-9">
                                    <input type="text" class="tpl-form-input" id="user-name" placeholder="{$v['role']}" name="role">
                                    
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-intro" class="am-u-sm-3 am-form-label">激活/禁用</label>
                                <div class="am-u-sm-9">
                                    <div class="tpl-switch">
                                        <input type="checkbox" class="ios-switch bigswitch tpl-switch-btn" name="status"
                                               checked={$v['status']}>
                                        <div class="tpl-switch-btn-view">
                                            <div>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                            <input type="hidden" name="vcode" value="1234">
                            <input type="hidden" name="hehe" value="dsadas">
                            <input type="hidden" name="haha" value="wwwww">
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3">
                                    <input type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success "
                                            id="admin-add-submit"}">
                                    <!--</button>-->
                                </div>
                            </div>
                        </form>
                            {/volist}
                    </div>
                </div>
            </div>
        </div>
</div>

<script>
    $('#add-admin').click(function(){
        $('#Modals').css('display','block');
        $('#Modals-add').css('display','block');
    });
    $('#Modals').click(function () {
            this.style.display = 'none';
    });
    //JS原生阻止事件冒泡
    document.getElementById('Modals-frame').addEventListener('click',function(e){e.stopPropagation()},false);

    $('#ajax').click(function(){
        var info = $('#Modals-from').serialize();
        // alert(info);
        $.ajax({
            type : 'post',
            data : info,
            url : 'index.php?c=User&a=ajaxadd',
            success : function (data) {
                $('#box').html(data);
            },
            error : function () {
                alert('error');
            }
        });
    });
</script>
{/block}
